﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Diagnostics;
using NS_OpenApiV3;
using System.Collections;

namespace PollServer
{
    public enum UPLOGTYPE
    {
        GET_DBINFO_TYPE = 0,    //从数据库中取数据
        CHRAGE_RET_TYPE = 1,    //充值确认

        UNION_LOGIN_LOG_TYPE = 11, //角色登入 (游戏联盟)
        UNION_BUY_LOG_TYPE = 12,  //充值货币消费 (游戏联盟)
        UNION_REGISTER_LOG_TYPE = 13, //注册 (游戏联盟)
        UNION_RECHARGE_LOG_TYPE = 14, //支付充值游戏币 (游戏联盟)
        /*
        UNION_REGISTER_RELOG_TYPE = 15, //联盟注册
        UNION_LOGIN_RELOG_TYPE = 16, //联盟登录
        UNION_PAYCHARGE_RELOG_TYPE = 17, //联盟支付充值
         */
        OPEN_CREATE_LOG_TYPE = 31, //创建角色 开平
        OPEN_LOGIN_LOG_TYPE = 32,  //角色登入 开平
        OPEN_QUIT_LOG_TYPE = 33, //角色登出 开平
        OPEN_BUY_LOG_TYPE = 34, //充值货币消费 开平
        OPEN_ONLINE_LOG_TYPE = 35, //开平在线角色数量统计 开平
        OPEN_RECHARGE_LOG_TYPE = 36, //开平充值货币 (开平数据)
        /*
        OPEN_BUY_RELOG_TYPE = 36, //开平货币消费
        OPEN_QUIT_RELOG_TYPE = 37, //开平登出
         */ 
        LPAN_BUY_LOG_TYPE = 50, //充值货币消费 (罗盘数据)
        LPAN_QUIT_LOG_TYPE = 51, //角色登出 (罗盘数据)
        LPAN_ONLINE_LOG_TYPE = 52, //罗盘在线角色数量统计
        /*
        LPAN_BUY_RELOG_TYPE = 52, //罗盘货币消费
        LPAN_QUIT_RELOG_TYPE = 53, //罗盘登出
        LPAN_REGISTER_RELOG_TYPE = 54, //罗盘注册
        LPAN_LOGIN_RELOG_TYPE = 55, //罗盘登录
        LPAN_ACCEPT_RELOG_TYPE = 56, //罗盘接受邀请注册
        LPAN_INVITE_RELOG_TYPE = 57, // 罗盘邀请他人注册
        LPAN_PAYCHARGE_RELOG_TYPE = 58, //罗盘支付充值
        */
        QQGAME_QUIT_LOG_TYPE = 70, //QQGAME角色登出
    };

    //存放数据库和日志库DB信息
    public class GameInfo
    {
        public GameDbInfo center_db;
        public GameDbInfo log_db;

        public GameInfo()
        {
            center_db = new GameDbInfo();
            log_db = new GameDbInfo();
        }
    };

    //平台上报数据处理函数
    public class LogPlat
    {   
        public OpenApiV3 sdk;
        //上报数据地址
        public string WebServer;
        //获取需要上报的平台名称
        public string platname;
        public Dictionary<string, UPLOGTYPE> func;

        public LogPlat()
        {
            func = new Dictionary<string, UPLOGTYPE>();
        }
    };

    //定义GameDb
    public class GameDbInfo
    {
        public string DBIP = "";
        public string DBName = "";
        public string Account = "";
        public string PassWord = "";
        public string DBPort = "";
    };

    //定义Queue节点
    public class DataNode
    {
        public DataTable _dt;
        public GameDbInfo _dbInfo;
        public UPLOGTYPE _type;
        public string funcname;
        public GameDbDelegate _delegate;
        public OpenApiV3 _sdk;
        public GameInfo _gmInfo;

        public DataNode(UPLOGTYPE type, GameDbInfo dbInfo, DataTable dt, OpenApiV3 sdk)
        {
            _type = type;
            _dbInfo = dbInfo;
            _dt = dt;
            _sdk = sdk;
        }

        public DataNode(GameDbDelegate gate, GameInfo gmInfo)
        {
            _type = UPLOGTYPE.GET_DBINFO_TYPE;
            _delegate = gate;
            _gmInfo = gmInfo;
        }

    };




}
